package com.gxa.insurance.service.impl;

import com.gxa.insurance.exception.BusinessException;
import com.gxa.insurance.mapper.InformationMapper;
import com.gxa.insurance.pojo.Information;
import com.gxa.insurance.service.InformationSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @date 2022/6/9
 */
@Service
public class InformatiomServiceImpl implements InformationSerivce {
    @Autowired
    InformationMapper informationMapper;

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public Integer add(Information information) {
        return informationMapper.add(information);
    }

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public void update(Information information) {
        informationMapper.update(information);
    }

    @Transactional(rollbackFor = Throwable.class)
    @Override
    public void delete(String name) throws BusinessException {

        informationMapper.delete(name);

    }


}
